#include<iostream>
#include<vector>
#include<iomanip>
using namespace std;

int main()
{
    int  n, k;
    cin >> n >> k;
    vector<double> p(n + 1);
    for (int i = 1;i <= n;i++)
    {
        cin >> p[i];
    }
    double sum = 0;
    for (int i = 1;i <= n;i++)
    {
        sum += p[i];
    }
    cout << fixed << setprecision(4) << sum << endl;
    vector<double> dp(n + 1);
    dp[0] = 1;
    for (int i = 1;i <= n;i++)
    {
        for (int j = min(j, k);j > 0;j--)
        {
            dp[j] = dp[j - 1] * p[j] + dp[j] * (1 - p[j]);
        }
        dp[0] = dp[0] * (1 - p[i]);
    }
    cout << fixed << setprecision(4) << dp[k] << endl;
    return 0;
}